package com.cal.utms.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.cal.utms.logAudit.AuditLogInt;
import com.cal.utms.util.ValueConvert;

/**
 * The persistent class for the issuer_type database table.
 * 
 */
@Entity
@Table(name = "issuer_type")
@NamedQuery(name = "IssuerType.findAll", query = "SELECT i FROM IssuerType i")
public class IssuerType implements Serializable, AuditLogInt {
	private static final long serialVersionUID = 1L;

	@Id
	private int id;

	@Column(name = "CODE")
	private String code;

	@Column(name = "ISSURE_CATEGORY")
	private String issureCategory;

	@Column(name = "PRIMARY_DEALER")
	private boolean primaryDealer;

	@Column(name = "MAX_INVESTMENT_RATE")
	private int maxinvestment;

	public IssuerType() {
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getIssureCategory() {
		return this.issureCategory;
	}

	public void setIssureCategory(String issureCategory) {
		this.issureCategory = issureCategory;
	}

	public boolean getPrimaryDealer() {
		return this.primaryDealer;
	}

	public void setPrimaryDealer(boolean primaryDealer) {
		this.primaryDealer = primaryDealer;
	}

	public int getMaxinvestment() {
		return maxinvestment;
	}

	public void setMaxinvestment(int maxinvestment) {
		this.maxinvestment = maxinvestment;
	}

	@Transient
	@Override
	public Long getLogId() {
		return ValueConvert.toLong(this.id);
	}

	@Transient
	@Override
	public String getLogDeatil() {
		StringBuilder sb = new StringBuilder();
		sb.append("Issuer Category : ").append(id).append("Category Code : ").append(code);

		return sb.toString();
	}
}